<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
		<title>物流详情</title>
		<link rel="stylesheet" href="<?php echo IMG_PATH ?>bdkd/css/common.css" />
		<link rel="stylesheet" href="<?php echo IMG_PATH ?>bdkd/css/details.css" />
	</head>
	<body>
		<div class="top">
			<div class="top_touxiang ">
				<img src="<?php echo IMG_PATH ?>bdkd/img/zhaowenguang.png"/>
			</div>
			<div class="top_xinxi">
				<p>物流状态：<span><?php echo $info['state']; ?></span></p>
				<p>承运来源：<span>

                        <?php
                        if($info['code']=='zhongtong'){
                            ?>
                            中通
                            <?php
                        }
                        if($info['code']=='yousuwuliu'){
                            ?>
                            优速物流
                            <?php
                        }
                        if($info['code']=='yunda'){
                            ?>
                            韵达
                            <?php
                        }
                        if($info['code']=='yuantong'){
                            ?>
                            圆通
                            <?php
                        }
                        if($info['code']=='shunfeng'){
                            ?>
                            顺丰
                            <?php
                        }
                        if($info['code']=='debangwuliu'){
                            ?>
                            德邦物流
                            <?php
                        }
                        if($info['code']=='huitongkuaidi'){
                            ?>
                            百世汇通
                            <?php
                        }
                        if($info['code']=='shentong'){
                            ?>
                            申通
                            <?php
                        }
                        ?>
                    </span></p>
				<p>运单编号：<span><?php echo $info['ex_order']; ?></span></p>
			</div>
			
		</div>
        <?php
        if(!empty($info['list'])){
            ?>
            <div class="content">
                <div class="con_left">

                </div>
                <div class="con_right">

                    <?php
                    foreach ($info['list'] as $value){
                        ?>
                        <div class="neirong">
                            <p><?php echo $value['context']?></p>
                            <div>
                                <span><?php echo $value['time']?></span>
                            </div>
                        </div>
                        <?php
                    }
                    ?>
<!--                    <div class="neirong">-->
<!--                        <p>[北京市]快件已签收，感谢您使用圆通快递，期待再次为为您服务！</p>-->
<!--                        <div>-->
<!--                            <span>2017-06-07 11:57:37</span>-->
<!--                        </div>-->
<!--                    </div>-->
<!--                    <div class="neirong">-->
<!--                        <p>[北京市]北京永峰派件员：业务部-李易峰<span>13834678903</span>正在为您派件。</p>-->
<!--                        <div>-->
<!--                            <span>2017-06-07 11:57:37</span>-->
<!---->
<!--                        </div>-->
<!--                    </div>-->
<!--                    <div class="neirong">-->
<!--                        <p>[北京市]快件已到达北京。</p>-->
<!--                        <div>-->
<!--                            <span>2017-06-07 11:57:57</span>-->
<!---->
<!--                        </div>-->
<!--                    </div>-->
<!--                    <div class="neirong">-->
<!--                        <p>[北京市]快件已到达北京。</p>-->
<!--                        <div>-->
<!--                            <span>2017-06-07 11:57:37</span>-->
<!---->
<!--                        </div>-->
<!--                    </div>-->
                </div>
            </div>
            <?php
        }
        ?>

	</body>
	<script type="text/javascript" src="<?php echo IMG_PATH ?>bdkd/js/jquery-1.11.0.js" ></script>
    <script type="text/javascript" src="<?php echo IMG_PATH ?>bdkd/js/rem.js" ></script>
    <script type="text/javascript">
//
//  	var leg=$(".neirong").length
        var lis=[]
        lis=$(".con_right .neirong")
        var shuzu=[]
//  	var hei =$(".neirong").height()
        var hei = [];
    	for (var i=0;i<$(".neirong").length;i++) {
    		$(".neirong")[i].index=i
    		hei[i] = $(".neirong").eq(i).outerHeight()+11.5;
//  		找出时间
            var tmp={}
    		var riqi=$(".neirong span").html()
    		var hms=$(".neirong e").html()
            var sun=riqi+" "+hms
           	tmp.dom=lis.eq(i)
//          console.log(dates)
//           console.log(sun)
//           把时间转成秒
             var sum=new Date(sun).getTime()
              tmp.dates=sum
             shuzu.push(tmp);
//           console.log(shuzu.push(tmp))
//			(function(i){
				$(".con_left").append("<b></b><span style='height:"+hei[i]+"px'></span>")
	//  		$(".con_left span").css("height",hei[i])
//				$(".con_left span").attr("style","height:"+hei[i]+"px");
	    		console.log(hei[i])
//			})(i)
    		
    		
    	}     
         $(".con_left span:last-child").remove()
         shuzu.sort(function(a,b){
         	if(a>b){
         	  return a-b
         	}
         })
         
         
         
         
         $(".neirong").remove()
         for (var i=0;i<shuzu.length;i++) {
         	$(".con_right").append(shuzu[i].dom)
         }
         
    </script>
</html>
